package com.huike.common.core.page;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 表格分页数据对象
 *
 * @author zhouao
 * @date 2022/05/14
 */
public class TableDataInfo implements Serializable {

    /**
     * 串行版本uid
     */
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    private long total;

    /**
     *
     */
    private List<?> rows;

    /**
     *
     */
    private int code;

    /**
     *
     */
    private String msg;

    /**
     *
     */
    private Map<String, Object> params;

    /**
     * 表格数据对象
     */
    public TableDataInfo() {
    }

    /**
     * 分页
     *
     * @param list  列表数据
     * @param total 总记录数
     */
    public TableDataInfo(List<?> list, int total) {
        this.rows = list;
        this.total = total;
    }

    /**
     * @return {@link Map}<{@link String}, {@link Object}>
     */
    public Map<String, Object> getParams() {
        return params;
    }

    /**
     * @param params
     */
    public void setParams(Map<String, Object> params) {
        this.params = params;
    }

    /**
     * @return long
     */
    public long getTotal() {
        return total;
    }

    /**
     * @param total
     */
    public void setTotal(long total) {
        this.total = total;
    }

    /**
     * @return {@link List}<{@link ?}>
     */
    public List<?> getRows() {
        return rows;
    }

    /**
     * @param rows
     */
    public void setRows(List<?> rows) {
        this.rows = rows;
    }

    /**
     * @return int
     */
    public int getCode() {
        return code;
    }

    /**
     * @param code
     */
    public void setCode(int code) {
        this.code = code;
    }

    /**
     * @return {@link String}
     */
    public String getMsg() {
        return msg;
    }

    /**
     * @param msg
     */
    public void setMsg(String msg) {
        this.msg = msg;
    }
}
